# -*- coding: utf-8 -*-
"""
@Time    : 2024/10/10 14:01 
@Author  : ZhangShenao 
@File    : recharge_task.py 
@Desc    : 充值任务
"""
from threading import Thread

from account import Account


class RechargeTask(Thread):
    """充值任务"""

    def __init__(self, account: Account, amount: int):
        """
        构造函数
        :param account: 充值账户
        :param amount: 充值金额
        """

        # 执行父类初始化
        super().__init__()

        # 初始化账户和转账金额
        self._account = account
        self._amount = amount

    def run(self):
        self._account.recharge(self._amount)
